<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Test extends CI_Controller
{

	public function lolwut()
	{
		$html = $this->load->view('legalforms/form_137_a','',TRUE);
		echo $html;
		// $this->load->library('mpdf');
		// $filename = 'test_file_name';
		// $mpdf=new mPDF('c','A4','','' , 5 , 5 , 5 , 5 , 0 , 0);
		// $mpdf->SetDisplayMode('fullpage');
		// $mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		// $mpdf->WriteHTML($html);
		// $mpdf->Output($filename,'I');
	}

	public function primary_insert()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_primary_insert',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Primary Insert Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 20 , 20 , 20 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}

	public function secondary_insert()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_secondary_insert',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Secondary Level Insert Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 20 , 20 , 20 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function intermediate_insert()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_intermediate_insert',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Intermediate Level Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 20 , 10 , 20 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function permit_to_leave_school_premises_alone()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_permit_to_leave_school_premises_alone',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Permit To Leave School Premises Alone Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 20 , 10 , 20 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function teachers_copy()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_teachers_copy',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Teachers Copy Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 20 , 10 , 20 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function emergency()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_emergency',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Emergency Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 20 , 10 , 20 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function pupils_ledger()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_pupils_ledger',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Pupils Ledger Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 20 , 20 , 20 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->AddPage('L');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function bus_service()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_bus_service',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Bus Service Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 20 , 20 , 20 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->AddPage('L');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function registration()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_registration',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Registration Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 10 , 10 , 10 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function home_school_agreement()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_home_school_agreement',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Home-School Agreement Form: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 10 , 10 , 10 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function promisory_note()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_promisory_note',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Promisory Note: ';
		$mpdf=new mPDF('c','A4','','' , 20 , 20 , 20 , 20 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function rfd_form()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_rfd',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Request For Disbursement Form (RFD): ';
		$mpdf=new mPDF('c','A4','','' , 10 , 5 , 20 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function progress_report_nursery_level()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/progress_report_nursery_level',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Progress Report: Nursery Level';
		$mpdf=new mPDF('c','LEGAL','','' , 5 , 5 , 10 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function progress_report_prep_1_level()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/progress_report_prep_1_level',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Progress Report: Prep 1 Level';
		$mpdf=new mPDF('c','LEGAL','','' , 5 , 5 , 10 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function progress_report_prep_2_level()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/progress_report_prep_2_level',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Progress Report: Prep 2 Level';
		$mpdf=new mPDF('c','LEGAL','','' , 5 , 5 , 10 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function cash_advance_liquidation_form()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/form_cash_advance_liquidation',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Cash Advance Liquidation Form';
		$mpdf=new mPDF('c','LEGAL','','' , 10 , 5 , 10 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function reminder()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/reminder',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Reminder';
		$mpdf=new mPDF('c','LEGAL','','' , 5 , 5 , 5 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function second_reminder()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/second_reminder',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Second Reminder';
		$mpdf=new mPDF('c','LEGAL','','' , 10 , 10 , 10 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function third_reminder()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/third_reminder',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Third Reminder';
		$mpdf=new mPDF('c','LEGAL','','' , 20 , 20 , 20 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function last_final_reminder()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/last_final_reminder',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Last And Final Reminder';
		$mpdf=new mPDF('c','LEGAL','','' , 20 , 20 , 20 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function implementation_letter()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/implementation_letter',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Implementation Letter';
		$mpdf=new mPDF('c','LEGAL','','' , 20 , 20 , 20 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function disbursement_voucher()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/disbursement_voucher',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Disbursement Voucher (DV)';
		$mpdf=new mPDF('c','LEGAL','','' , 10 , 10 , 10 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function bus_service_contract()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/bus_service_contract',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Bus Service Contract';
		$mpdf=new mPDF('c','LEGAL','','' , 10 , 10 , 10 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function foreign_students_list()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/foreign_students_list',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Foreign Students List';
		$mpdf=new mPDF('c','LEGAL','','' , 10 , 10 , 10 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->AddPage('L');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function insurance_reports()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/insurance_reports',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Insurance Reports';
		$mpdf=new mPDF('c','A4','','' , 5 , 15 , 10 , 0 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->AddPage('L');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function p1_test_form()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/p1_test_form',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'P1 Test Form';
		$mpdf=new mPDF('c','A4','','' , 10 , 10 , 10 , 10 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function p2_test_form()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/p2_test_form',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'P2 Test Form';
		$mpdf=new mPDF('c','A4','','' , 10 , 10 , 10 , 10 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function elem_int_test_form()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/elem_int_test_form',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Elem/Int. Test Form';
		$mpdf=new mPDF('c','A4','','' , 10 , 10 , 10 , 10 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function advanced_test_form()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/advanced_test_form',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Advanced Test Form';
		$mpdf=new mPDF('c','A4','','' , 10 , 10 , 10 , 10 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function applicant_information()
	{
		
		$this->load->model(array('M_school_settings','M_gperiods','M_school_years'));
		$query = $this->M_school_settings->get_all_school_setting();
			
			if(!empty($query))
			{
				$data['school_name'] = $query->school_name;
				$data['school_address'] = $query->school_address;
				$data['school_telephone'] = $query->school_telephone;
				$data['school_email'] = $query->school_email;
			}
		
		$html = $this->load->view('legalforms/applicant_information',$data,TRUE);
		
		$this->load->library('mpdf');
		$filename = 'Applicant Information';
		$mpdf=new mPDF('c','A4','','' , 10 , 10 , 10 , 10 , 0 , 0);
		$mpdf->SetDisplayMode('fullpage');
		$mpdf->AddPage('L');
		$mpdf->list_indent_first_level = 0;  // 1 or 0 - whether to indent the first level of a list
		$mpdf->WriteHTML($html);
		$mpdf->Output($filename,'I');
	
	}
	
	public function query_check()
	{
		header("Content-type: text");
		
		function hash_password($password)
		{
			$salt = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));
			$hash = hash('sha256', $salt . $password);

			return $salt . $hash;
		}
	
		$select = "SELECT e_student_id FROM enrollments";
		
		$q= $this->db->query($select);

		$data = 'INSERT INTO `users`(`username`,`hashed_password`,`userType`,`userStatus`) values ';
		
		foreach($q->result() as $k => $v)
		{
		
			$data .=  "('".$v->e_student_id."','".hash_password($v->e_student_id)."','student','active'),";
			
			// $insert[$k][]['username'] = $v->e_student_id;
			// $insert[$k][]['hashed_password'] = hash_password($v->e_student_id);
			// $insert[$k][]['userType'] = 'student';
			// $insert[$k][]['userStatus`'] = 'active';
		}
		
		echo $data;
	}
	
	public function age()
	{
		$birthday = strtotime('1990-3-9');
		$time = time();
		$seconds = $time - $birthday;
		echo $age = floor($seconds / 31536000);
	}
}